package com.anlu.base.utils;

/**
 * <p>
 * Description:TODO 详细描述
 * <p>
 * <p>
 *
 * @author anlu
 * @date 2024/9/24 16:35
 */
public class KvEntry <K,V>{

    private K key;

    /**
     * value 任意值
     */
    private V value;

    public KvEntry() {
    }

    public KvEntry(K key, V value) {
        this.key = key;
        this.value = value;
    }

    public  final static<KK,VV> KvEntry<KK,VV> newInstance(KK key, VV value) {
        return new KvEntry<KK, VV>(key, value);

    }

    public K getKey() {
        return key;
    }

    public void setKey(K key) {
        this.key = key;
    }

    public V getValue() {
        return value;
    }

    public void setValue(V value) {
        this.value = value;
    }

    @Override
    public String toString() {
        return this.getClass().getSimpleName() + "["
                + " key=" + key + ","
                + " value=" + value
                + " ]";
    }
}
